/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 有点呆
 * Date: 2024-03-01
 * Time: 21:51
 */
public class Test {
//    求最大公约数
    public static void main(String[] args) {
        int a = 24;
        int b = 18;
        int c = a % b;
        while(c != 0){
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }
}
